package xin.mashibo.pattern.composite;

/**
 * 文件条目类
 *
 * @author MaShibo
 * 日期 :  2019/1/24
 */
public abstract class Entry {

    public abstract String getName();

    public abstract int getSize();

    public Entry add(Entry entry) throws FileTreatMentException {
        throw new FileTreatMentException();
    }

    public void printList() {
        printList("");
    }

    protected abstract void printList(String prefix);

    @Override
    public String toString() {
        return getName() + " (" + getSize() + ") ";
    }

}
